package com.jt.controller;

import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {

@Autowired
private RightsService rightsService;

@GetMapping("/getRightsList")
public SysResult getRightsList(){
 List<Rights> list=rightsService.getRightsList();
 return SysResult.success(list);
}



 @GetMapping("/{id}")
 public Rights getRights(@PathVariable Integer id){
  return rightsService.getRights(id);
 }

@GetMapping("/list")
 public List<Rights> list(){
  return rightsService.list();
}

}
